package com.itheima.bean;

import java.io.Serializable;

import javax.servlet.http.HttpSessionActivationListener;
import javax.servlet.http.HttpSessionEvent;

public class User1 implements HttpSessionActivationListener ,Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String username;
	private String password;
	
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	
	public User1(String username, String password) {
		super();
		this.username = username;
		this.password = password;
	}
	
	
	public User1() {
		// TODO Auto-generated constructor stub
	}
	//钝化(把session中的数据钝化到磁盘上)
	@Override
	public void sessionWillPassivate(HttpSessionEvent se) {
		// TODO Auto-generated method stub
		System.out.println("session中的bean放入了服务器磁盘中");
	}
	//活化(从磁盘中把数据读取回session)
	@Override
	public void sessionDidActivate(HttpSessionEvent se) {
		// TODO Auto-generated method stub
		System.out.println("从服务器磁盘中把数据活化到session中");
	}

}
